﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;

namespace IsPay.api
{
    /// <summary>
    /// authCodeCheck 的摘要说明
    /// </summary>
    public class authCodeCheck : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            string retCode = "-1";

            if (context.Session["VARIFYCODE"] != null)
            {
                string rVarifyCode = context.Request.Params["authCode"].ToString();
                string sVarifyCode = context.Session["VARIFYCODE"].ToString();

                if (rVarifyCode.ToUpper().Equals(sVarifyCode.ToUpper()))
                {
                    retCode = "0";
                }
            }

            context.Response.ContentType = "text/plain";
            context.Response.Write(retCode);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}